package com.th.supcom.pds.index.spring;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.web.context.support.XmlWebApplicationContext;

/**
 * 开发模式的Sping配置文件加载器.<br/>
 * 用于替换 发布模式下部分配置信息(数据源、文件服务等.)
 * 
 * @author mhuang.
 */
public class DevelopModelLoader extends XmlWebApplicationContext
{
    @Override
    public void refresh () throws BeansException, IllegalStateException
    {
        String developModelFile = System.getProperty ("contextConfigLocation");
        System.out.println (developModelFile);
        if (developModelFile != null)
        {
            setConfigLocation (developModelFile);
        }
        s_LOGGER.info ("获取Develop模式下Spring配置文件:【{}】", developModelFile);
        super.refresh ();
    }

    /** 日志记录器. */
    public static Logger s_LOGGER = LoggerFactory.getLogger (DevelopModelLoader.class);
    /** 公司版权信息. */
    public static final String copyright = "Copyright 2014, TH Supcom Corporation";
    /** 提交路径. */
    public static final String SCC_BRANCH = "$URL$";
    /** 提交日期. */
    public static final String SCC_LAST_MODIFICATION_DATE = "$Date$";
    /** 最终修改人员. */
    public static final String SCC_LAST_MODIFIER_NAME = "$Author$";
    /** 最终版本号. */
    public static final String SCC_REVISION = "$Revision$";
}